﻿using System;

namespace DivShare
{
    /// <summary>
    /// Provides data for the <see cref="E:DownloadWebFileProgressChanged"/> event of a <see cref="DivShareClient"/>.
    /// </summary>
    public class DownloadWebFileProgressChangedEventArgs : EventArgs
    {
        /// <summary>
        /// Gets the number of bytes received.
        /// </summary>
        /// <value>The number of bytes received.</value>
        public long BytesReceived { get; protected set; }

        /// <summary>
        /// Gets the total number of bytes that will be received.
        /// </summary>
        /// <value>The total number of bytes that will be received.</value>
        public long TotalBytesToReceive { get; protected set; }

        /// <summary>
        /// Gets the downloading task progress percentage.
        /// </summary>
        /// <value>The downloading task progress percentage.</value>
        public int ProgressPercentage { get; protected set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="DownloadWebFileProgressChangedEventArgs"/> class.
        /// </summary>
        /// <param name="bytesReceived">The number of bytes received.</param>
        /// <param name="totalBytesToReceive">The total number of bytes that will be received.</param>
        /// <param name="progressPercentage">The downloading task progress percentage.</param>
        internal DownloadWebFileProgressChangedEventArgs(long bytesReceived, long totalBytesToReceive, int progressPercentage)
        {
            BytesReceived = bytesReceived;
            TotalBytesToReceive = totalBytesToReceive;
            ProgressPercentage = progressPercentage;
        }
    }
}
